<script setup>

const props = defineProps({
  clothes: {
    type: Object,
    default: () => {}
  }
})

</script>


<template>
  <RouterLink :to="`/goodsDetail/${clothes.clNo}`" class="goods-item">
    <img :src="`http://localhost:8080/images/clothes/` + clothes.clNo + `.jpg`" alt="" />
    <p class="name ellipsis">{{ clothes.clName }}</p>
    <p v-if="clothes.clDescribe" class="desc ellipsis">{{ clothes.clDescribe }}</p>
    <p class="price">&yen;{{ clothes.clPrice }}</p>
  </RouterLink>

</template>

<style scoped>
.goods-item {
  display: inline-block;
  width: 220px;
  padding: 20px 30px;
  text-align: center;
  transition: all .5s;

  &:hover {
    transform: translate3d(0, -3px, 0);
    box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
  }

  img {
    width: 120px;
    height: 160px;
  }

  p {
    padding-top: 10px;
  }

  .name {
    font-size: 16px;
    color: #333;
  }

  .desc {
    color: #999;
    height: 30px;
  }

  .price {
    color: #CF4444;
    font-size: 20px;
  }
}

.ellipsis {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
</style>